Skip to content

Name the inputs of the stepped distance searches sectors, and the searches in the singular - #910

Merged
perlinm merged 3 commits into
mainfrom
refactor/distance-search-sectors
Nov 16, 2026
Merged

perlinm merged 3 commits into
mainfrom
refactor/distance-search-sectors

Conversation

@perlinm

@perlinm perlinm commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Motivation

#900 made the Brouwer-Zimmermann (BZ) and connected-cluster distance searches steppable objects, which take a list of inputs and advance one layer or weight limit at a time. It called those inputs problems and named the classes in the plural (BrouwerZimmermannSearches, ConnectedClusterSearches), as though a joint search of the X and Z sectors of a CSS code were several searches. But that joint search solves one problem, and the guides already call its parts sectors. This PR renames the inputs and classes to match, so that the code, its docstrings, and the guides use one vocabulary: a search solves one problem, made of one or more sectors.

Changes

  • problems becomes sectors in get_distance_brouwer_zimmermann, BrouwerZimmermannSearch, get_distance_connected_cluster, and ConnectedClusterSearch, with their docstrings and error messages ("Require at least one sector or an upper bound").
  • The classes take singular names: BrouwerZimmermannSearch and ConnectedClusterSearch. The BZ search of one sector, _BrouwerZimmermannSearch, becomes _SectorSearch, the function that prepares it becomes _prepare_sector_search, and get_distance_brouwer_zimmermann_many loses its suffix.
  • "Problem" stays where it means the mathematical task, as in "The problem" sections of brouwer_zimmermann.md and connected_cluster.md, SupportSearch, and wording shared with coset searches.
  • The README of qldpc.codes.distance adds that a search of a classical code, of a qubit code that is not CSS, or of a circuit examines one sector, and connected_cluster.md says the same of classical codes and codes that are not CSS.
  • Tests, docs/source/exact_search_tuning.rst, and experiments/distance_tuning/trace.py follow the rename. The trace script's JSON events now name a "sector" field instead of "problem", and benchmark.py in the same directory now says that it searches a non-CSS code as one sector.

All renamed objects are in private modules, so no deprecation is needed. Behavior is unchanged.

Validation

To confirm that the rename changes no search decision, experiments/distance_tuning/trace.py --compare compared the layer-by-layer decisions of main and this branch on ten workloads: BZ distances of CSS, non-CSS, and classical codes, a BZ logical count, and connected-cluster distances. All ten matched.

perlinm and others added 3 commits November 16, 2026 14:17
…rches in the singular

A joint search of the X and Z sectors of a CSS code is one problem with two sectors, so the
stepped searches take `sectors` and their classes have singular names: `BrouwerZimmermannSearch`,
`ConnectedClusterSearch`, and `_SectorSearch` for the BZ search of one sector.  The BZ entry point
loses its `_many` suffix.  Behavior is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Define a sector without "of one type", say in the BZ docstrings that each sector has a search,
call the sector in a test docstring by its name, and bring benchmark.py's description of non-CSS
searches in line with the README.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…he sector wording

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@perlinm
perlinm merged commit a9f86ed into main Nov 16, 2026
9 checks passed
@perlinm
perlinm deleted the refactor/distance-search-sectors branch November 16, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant